<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span id="local-6989586621680822335"></span><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE FlexibleContexts #-}</span><span>
</span><span id="line-3"></span><span>
</span><span id="line-4"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Types.RepType</span><span>
</span><span id="line-5"></span><span>  </span><span class="hs-special">(</span><span>
</span><span id="line-6"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Code generator views onto Types</span></span><span>
</span><span id="line-7"></span><span>    </span><span class="annot"><a href="GHC.Types.RepType.html#UnaryType"><span class="hs-identifier">UnaryType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#NvUnaryType"><span class="hs-identifier">NvUnaryType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#isNvUnaryType"><span class="hs-identifier">isNvUnaryType</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-8"></span><span>    </span><span class="annot"><a href="GHC.Types.RepType.html#unwrapType"><span class="hs-identifier">unwrapType</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-9"></span><span>
</span><span id="line-10"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Predicates on types</span></span><span>
</span><span id="line-11"></span><span>    </span><span class="annot"><a href="GHC.Types.RepType.html#isVoidTy"><span class="hs-identifier">isVoidTy</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-12"></span><span>
</span><span id="line-13"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Type representation for the code generator</span></span><span>
</span><span id="line-14"></span><span>    </span><span class="annot"><a href="GHC.Types.RepType.html#typePrimRep"><span class="hs-identifier">typePrimRep</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#typePrimRep1"><span class="hs-identifier">typePrimRep1</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-15"></span><span>    </span><span class="annot"><a href="GHC.Types.RepType.html#runtimeRepPrimRep"><span class="hs-identifier">runtimeRepPrimRep</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#typePrimRepArgs"><span class="hs-identifier">typePrimRepArgs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-16"></span><span>    </span><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier">PrimRep</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#primRepToType"><span class="hs-identifier">primRepToType</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-17"></span><span>    </span><span class="annot"><a href="GHC.Types.RepType.html#countFunRepArgs"><span class="hs-identifier">countFunRepArgs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#countConRepArgs"><span class="hs-identifier">countConRepArgs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#tyConPrimRep"><span class="hs-identifier">tyConPrimRep</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#tyConPrimRep1"><span class="hs-identifier">tyConPrimRep1</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-18"></span><span>
</span><span id="line-19"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Unboxed sum representation type</span></span><span>
</span><span id="line-20"></span><span>    </span><span class="annot"><a href="GHC.Types.RepType.html#ubxSumRepType"><span class="hs-identifier">ubxSumRepType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#layoutUbxSum"><span class="hs-identifier">layoutUbxSum</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#typeSlotTy"><span class="hs-identifier">typeSlotTy</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#SlotTy"><span class="hs-identifier">SlotTy</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>    </span><span class="annot"><a href="GHC.Types.RepType.html#slotPrimRep"><span class="hs-identifier">slotPrimRep</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#primRepSlot"><span class="hs-identifier">primRepSlot</span></a></span><span>
</span><span id="line-22"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-27"></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Basic.html#Arity"><span class="hs-identifier">Arity</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#RepArity"><span class="hs-identifier">RepArity</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html"><span class="hs-identifier">GHC.Core.DataCon</span></a></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.html"><span class="hs-identifier">GHC.Builtin.Names</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Coercion.html"><span class="hs-identifier">GHC.Core.Coercion</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html"><span class="hs-identifier">GHC.Core.TyCon</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html"><span class="hs-identifier">GHC.Core.TyCo.Rep</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.Prim.html"><span class="hs-identifier">GHC.Builtin.Types.Prim</span></a></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="hs-pragma">{-# SOURCE</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html"><span class="hs-identifier">GHC.Builtin.Types</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html#anyTypeOfKind"><span class="hs-identifier">anyTypeOfKind</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-39"></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.OldList.html#sort"><span class="hs-identifier">sort</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../containers/src/Data.IntSet.html#"><span class="hs-identifier">Data.IntSet</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">IS</span></span><span>
</span><span id="line-42"></span><span>
</span><span id="line-43"></span><span class="hs-comment">{- **********************************************************************
*                                                                       *
                Representation types
*                                                                       *
********************************************************************** -}</span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span class="hs-keyword">type</span><span> </span><span id="NvUnaryType"><span class="annot"><a href="GHC.Types.RepType.html#NvUnaryType"><span class="hs-identifier hs-var">NvUnaryType</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-50"></span><span class="hs-keyword">type</span><span> </span><span id="UnaryType"><span class="annot"><a href="GHC.Types.RepType.html#UnaryType"><span class="hs-identifier hs-var">UnaryType</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-51"></span><span>     </span><span class="hs-comment">-- Both are always a value type; i.e. its kind is TYPE rr</span><span>
</span><span id="line-52"></span><span>     </span><span class="hs-comment">-- for some rr; moreover the rr is never a variable.</span><span>
</span><span id="line-53"></span><span>     </span><span class="hs-comment">--</span><span>
</span><span id="line-54"></span><span>     </span><span class="hs-comment">--   NvUnaryType : never an unboxed tuple or sum, or void</span><span>
</span><span id="line-55"></span><span>     </span><span class="hs-comment">--</span><span>
</span><span id="line-56"></span><span>     </span><span class="hs-comment">--   UnaryType   : never an unboxed tuple or sum;</span><span>
</span><span id="line-57"></span><span>     </span><span class="hs-comment">--                 can be Void# or (# #)</span><span>
</span><span id="line-58"></span><span>
</span><span id="line-59"></span><span class="annot"><a href="GHC.Types.RepType.html#isNvUnaryType"><span class="hs-identifier hs-type">isNvUnaryType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-60"></span><span id="isNvUnaryType"><span class="annot"><span class="annottext">isNvUnaryType :: Type -&gt; Bool
</span><a href="GHC.Types.RepType.html#isNvUnaryType"><span class="hs-identifier hs-var hs-var">isNvUnaryType</span></a></span></span><span> </span><span id="local-6989586621680822251"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822251"><span class="hs-identifier hs-var">ty</span></a></span></span><span>
</span><span id="line-61"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">PrimRep
</span><span class="hs-identifier">_</span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; [PrimRep]
Type -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#typePrimRep"><span class="hs-identifier hs-var">typePrimRep</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822251"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-62"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-63"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-64"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-65"></span><span>
</span><span id="line-66"></span><span class="hs-comment">-- INVARIANT: the result list is never empty.</span><span>
</span><span id="line-67"></span><span class="annot"><a href="GHC.Types.RepType.html#typePrimRepArgs"><span class="hs-identifier hs-type">typePrimRepArgs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html#HasDebugCallStack"><span class="hs-identifier hs-type">HasDebugCallStack</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier hs-type">PrimRep</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-68"></span><span id="typePrimRepArgs"><span class="annot"><span class="annottext">typePrimRepArgs :: HasDebugCallStack =&gt; Type -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#typePrimRepArgs"><span class="hs-identifier hs-var hs-var">typePrimRepArgs</span></a></span></span><span> </span><span id="local-6989586621680822249"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822249"><span class="hs-identifier hs-var">ty</span></a></span></span><span>
</span><span id="line-69"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[PrimRep]
</span><a href="#local-6989586621680822248"><span class="hs-identifier hs-var">reps</span></a></span><span>
</span><span id="line-70"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#VoidRep"><span class="hs-identifier hs-var">VoidRep</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-71"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-72"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[PrimRep]
</span><a href="#local-6989586621680822248"><span class="hs-identifier hs-var">reps</span></a></span><span>
</span><span id="line-73"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-74"></span><span>    </span><span id="local-6989586621680822248"><span class="annot"><span class="annottext">reps :: [PrimRep]
</span><a href="#local-6989586621680822248"><span class="hs-identifier hs-var hs-var">reps</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; [PrimRep]
Type -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#typePrimRep"><span class="hs-identifier hs-var">typePrimRep</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822249"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-75"></span><span>
</span><span id="line-76"></span><span class="hs-comment">-- | Gets rid of the stuff that prevents us from understanding the</span><span>
</span><span id="line-77"></span><span class="hs-comment">-- runtime representation of a type. Including:</span><span>
</span><span id="line-78"></span><span class="hs-comment">--   1. Casts</span><span>
</span><span id="line-79"></span><span class="hs-comment">--   2. Newtypes</span><span>
</span><span id="line-80"></span><span class="hs-comment">--   3. Foralls</span><span>
</span><span id="line-81"></span><span class="hs-comment">--   4. Synonyms</span><span>
</span><span id="line-82"></span><span class="hs-comment">-- But not type/data families, because we don't have the envs to hand.</span><span>
</span><span id="line-83"></span><span class="annot"><a href="GHC.Types.RepType.html#unwrapType"><span class="hs-identifier hs-type">unwrapType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-84"></span><span id="unwrapType"><span class="annot"><span class="annottext">unwrapType :: Type -&gt; Type
</span><a href="GHC.Types.RepType.html#unwrapType"><span class="hs-identifier hs-var hs-var">unwrapType</span></a></span></span><span> </span><span id="local-6989586621680822245"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822245"><span class="hs-identifier hs-var">ty</span></a></span></span><span>
</span><span id="line-85"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">()
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680822244"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822244"><span class="hs-identifier hs-var">unwrapped</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-86"></span><span>      </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">NormaliseStepper () -&gt; (() -&gt; () -&gt; ()) -&gt; Type -&gt; Maybe ((), Type)
forall ev.
NormaliseStepper ev -&gt; (ev -&gt; ev -&gt; ev) -&gt; Type -&gt; Maybe (ev, Type)
</span><a href="GHC.Core.Coercion.html#topNormaliseTypeX"><span class="hs-identifier hs-var">topNormaliseTypeX</span></a></span><span> </span><span class="annot"><span class="annottext">NormaliseStepper ()
</span><a href="#local-6989586621680822242"><span class="hs-identifier hs-var">stepper</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; () -&gt; ()
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var">mappend</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822241"><span class="hs-identifier hs-var">inner_ty</span></a></span><span>
</span><span id="line-87"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822244"><span class="hs-identifier hs-var">unwrapped</span></a></span><span>
</span><span id="line-88"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-89"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822241"><span class="hs-identifier hs-var">inner_ty</span></a></span><span>
</span><span id="line-90"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-91"></span><span>    </span><span id="local-6989586621680822241"><span class="annot"><span class="annottext">inner_ty :: Type
</span><a href="#local-6989586621680822241"><span class="hs-identifier hs-var hs-var">inner_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type
</span><a href="#local-6989586621680822240"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822245"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-92"></span><span>
</span><span id="line-93"></span><span>    </span><span id="local-6989586621680822240"><span class="annot"><span class="annottext">go :: Type -&gt; Type
</span><a href="#local-6989586621680822240"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621680822239"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822239"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680822238"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822238"><span class="hs-identifier hs-var">t'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Maybe Type
</span><a href="GHC.Core.Type.html#coreView"><span class="hs-identifier hs-var">coreView</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822239"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type
</span><a href="#local-6989586621680822240"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822238"><span class="hs-identifier hs-var">t'</span></a></span><span>
</span><span id="line-94"></span><span>    </span><span class="annot"><a href="#local-6989586621680822240"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#ForAllTy"><span class="hs-identifier hs-type">ForAllTy</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVarBinder
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680822235"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822235"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">)</span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type
</span><a href="#local-6989586621680822240"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822235"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-95"></span><span>    </span><span class="annot"><a href="#local-6989586621680822240"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#CastTy"><span class="hs-identifier hs-type">CastTy</span></a></span><span> </span><span id="local-6989586621680822233"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822233"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="annot"><span class="annottext">KindCoercion
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type
</span><a href="#local-6989586621680822240"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822233"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-96"></span><span>    </span><span class="annot"><a href="#local-6989586621680822240"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621680822232"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822232"><span class="hs-identifier hs-var">t</span></a></span></span><span>                         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822232"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-97"></span><span>
</span><span id="line-98"></span><span>     </span><span class="hs-comment">-- cf. Coercion.unwrapNewTypeStepper</span><span>
</span><span id="line-99"></span><span>    </span><span id="local-6989586621680822242"><span class="annot"><span class="annottext">stepper :: NormaliseStepper ()
</span><a href="#local-6989586621680822242"><span class="hs-identifier hs-var hs-var">stepper</span></a></span></span><span> </span><span id="local-6989586621680822231"><span class="annot"><span class="annottext">RecTcChecker
</span><a href="#local-6989586621680822231"><span class="hs-identifier hs-var">rec_nts</span></a></span></span><span> </span><span id="local-6989586621680822230"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680822230"><span class="hs-identifier hs-var">tc</span></a></span></span><span> </span><span id="local-6989586621680822229"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680822229"><span class="hs-identifier hs-var">tys</span></a></span></span><span>
</span><span id="line-100"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680822228"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822228"><span class="hs-identifier hs-var">ty'</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">KindCoercion
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; [Type] -&gt; Maybe (Type, KindCoercion)
</span><a href="GHC.Core.Coercion.html#instNewTyCon_maybe"><span class="hs-identifier hs-var">instNewTyCon_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680822230"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680822229"><span class="hs-identifier hs-var">tys</span></a></span><span>
</span><span id="line-101"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">RecTcChecker -&gt; TyCon -&gt; Maybe RecTcChecker
</span><a href="GHC.Core.TyCon.html#checkRecTc"><span class="hs-identifier hs-var">checkRecTc</span></a></span><span> </span><span class="annot"><span class="annottext">RecTcChecker
</span><a href="#local-6989586621680822231"><span class="hs-identifier hs-var">rec_nts</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680822230"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-102"></span><span>          </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680822225"><span class="annot"><span class="annottext">RecTcChecker
</span><a href="#local-6989586621680822225"><span class="hs-identifier hs-var">rec_nts'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">RecTcChecker -&gt; Type -&gt; () -&gt; NormaliseStepResult ()
forall ev. RecTcChecker -&gt; Type -&gt; ev -&gt; NormaliseStepResult ev
</span><a href="GHC.Core.Coercion.html#NS_Step"><span class="hs-identifier hs-var">NS_Step</span></a></span><span> </span><span class="annot"><span class="annottext">RecTcChecker
</span><a href="#local-6989586621680822225"><span class="hs-identifier hs-var">rec_nts'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type
</span><a href="#local-6989586621680822240"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822228"><span class="hs-identifier hs-var">ty'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-103"></span><span>          </span><span class="annot"><span class="annottext">Maybe RecTcChecker
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NormaliseStepResult ()
forall ev. NormaliseStepResult ev
</span><a href="GHC.Core.Coercion.html#NS_Abort"><span class="hs-identifier hs-var">NS_Abort</span></a></span><span>   </span><span class="hs-comment">-- infinite newtypes</span><span>
</span><span id="line-104"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-105"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NormaliseStepResult ()
forall ev. NormaliseStepResult ev
</span><a href="GHC.Core.Coercion.html#NS_Done"><span class="hs-identifier hs-var">NS_Done</span></a></span><span>
</span><span id="line-106"></span><span>
</span><span id="line-107"></span><span class="annot"><a href="GHC.Types.RepType.html#countFunRepArgs"><span class="hs-identifier hs-type">countFunRepArgs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Arity"><span class="hs-identifier hs-type">Arity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#RepArity"><span class="hs-identifier hs-type">RepArity</span></a></span><span>
</span><span id="line-108"></span><span id="countFunRepArgs"><span class="annot"><span class="annottext">countFunRepArgs :: Int -&gt; Type -&gt; Int
</span><a href="GHC.Types.RepType.html#countFunRepArgs"><span class="hs-identifier hs-var hs-var">countFunRepArgs</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-109"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-110"></span><span class="annot"><a href="GHC.Types.RepType.html#countFunRepArgs"><span class="hs-identifier hs-var">countFunRepArgs</span></a></span><span> </span><span id="local-6989586621680822221"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680822221"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621680822220"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822220"><span class="hs-identifier hs-var">ty</span></a></span></span><span>
</span><span id="line-111"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#FunTy"><span class="hs-identifier hs-type">FunTy</span></a></span><span> </span><span class="annot"><span class="annottext">AnonArgFlag
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680822218"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822218"><span class="hs-identifier hs-var">arg</span></a></span></span><span> </span><span id="local-6989586621680822217"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822217"><span class="hs-identifier hs-var">res</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type
</span><a href="GHC.Types.RepType.html#unwrapType"><span class="hs-identifier hs-var">unwrapType</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822220"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-112"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[PrimRep] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; [PrimRep]
Type -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#typePrimRepArgs"><span class="hs-identifier hs-var">typePrimRepArgs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822218"><span class="hs-identifier hs-var">arg</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Type -&gt; Int
</span><a href="GHC.Types.RepType.html#countFunRepArgs"><span class="hs-identifier hs-var">countFunRepArgs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680822221"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822217"><span class="hs-identifier hs-var">res</span></a></span><span>
</span><span id="line-113"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-114"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; Int
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;countFunRepArgs: arity greater than type can handle&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Int, Type, [PrimRep]) -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680822221"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822220"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; [PrimRep]
Type -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#typePrimRep"><span class="hs-identifier hs-var">typePrimRep</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822220"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-115"></span><span>
</span><span id="line-116"></span><span class="annot"><a href="GHC.Types.RepType.html#countConRepArgs"><span class="hs-identifier hs-type">countConRepArgs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#RepArity"><span class="hs-identifier hs-type">RepArity</span></a></span><span>
</span><span id="line-117"></span><span id="countConRepArgs"><span class="annot"><span class="annottext">countConRepArgs :: DataCon -&gt; Int
</span><a href="GHC.Types.RepType.html#countConRepArgs"><span class="hs-identifier hs-var hs-var">countConRepArgs</span></a></span></span><span> </span><span id="local-6989586621680822212"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680822212"><span class="hs-identifier hs-var">dc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Type -&gt; Int
</span><a href="#local-6989586621680822211"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; Int
</span><a href="GHC.Core.DataCon.html#dataConRepArity"><span class="hs-identifier hs-var">dataConRepArity</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680822212"><span class="hs-identifier hs-var">dc</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; Type
</span><a href="GHC.Core.DataCon.html#dataConRepType"><span class="hs-identifier hs-var">dataConRepType</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680822212"><span class="hs-identifier hs-var">dc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-118"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-119"></span><span>    </span><span class="annot"><a href="#local-6989586621680822211"><span class="hs-identifier hs-type">go</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Arity"><span class="hs-identifier hs-type">Arity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#RepArity"><span class="hs-identifier hs-type">RepArity</span></a></span><span>
</span><span id="line-120"></span><span>    </span><span id="local-6989586621680822211"><span class="annot"><span class="annottext">go :: Int -&gt; Type -&gt; Int
</span><a href="#local-6989586621680822211"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-121"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-122"></span><span>    </span><span class="annot"><a href="#local-6989586621680822211"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621680822208"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680822208"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621680822207"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822207"><span class="hs-identifier hs-var">ty</span></a></span></span><span>
</span><span id="line-123"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#FunTy"><span class="hs-identifier hs-type">FunTy</span></a></span><span> </span><span class="annot"><span class="annottext">AnonArgFlag
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680822206"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822206"><span class="hs-identifier hs-var">arg</span></a></span></span><span> </span><span id="local-6989586621680822205"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822205"><span class="hs-identifier hs-var">res</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type
</span><a href="GHC.Types.RepType.html#unwrapType"><span class="hs-identifier hs-var">unwrapType</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822207"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-124"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[PrimRep] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; [PrimRep]
Type -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#typePrimRep"><span class="hs-identifier hs-var">typePrimRep</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822206"><span class="hs-identifier hs-var">arg</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Type -&gt; Int
</span><a href="#local-6989586621680822211"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680822208"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822205"><span class="hs-identifier hs-var">res</span></a></span><span>
</span><span id="line-125"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-126"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; Int
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;countConRepArgs: arity greater than type can handle&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Int, Type, [PrimRep]) -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680822208"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822207"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; [PrimRep]
Type -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#typePrimRep"><span class="hs-identifier hs-var">typePrimRep</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822207"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-127"></span><span>
</span><span id="line-128"></span><span class="hs-comment">-- | True if the type has zero width.</span><span>
</span><span id="line-129"></span><span class="annot"><a href="GHC.Types.RepType.html#isVoidTy"><span class="hs-identifier hs-type">isVoidTy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-130"></span><span id="isVoidTy"><span class="annot"><span class="annottext">isVoidTy :: Type -&gt; Bool
</span><a href="GHC.Types.RepType.html#isVoidTy"><span class="hs-identifier hs-var hs-var">isVoidTy</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[PrimRep] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">([PrimRep] -&gt; Bool) -&gt; (Type -&gt; [PrimRep]) -&gt; Type -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; [PrimRep]
Type -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#typePrimRep"><span class="hs-identifier hs-var">typePrimRep</span></a></span><span>
</span><span id="line-131"></span><span>
</span><span id="line-132"></span><span>
</span><span id="line-133"></span><span class="hs-comment">{- **********************************************************************
*                                                                       *
                Unboxed sums
 See Note [Translating unboxed sums to unboxed tuples] in GHC.Stg.Unarise
*                                                                       *
********************************************************************** -}</span><span>
</span><span id="line-139"></span><span>
</span><span id="line-140"></span><span class="hs-keyword">type</span><span> </span><span id="SortedSlotTys"><span class="annot"><a href="GHC.Types.RepType.html#SortedSlotTys"><span class="hs-identifier hs-var">SortedSlotTys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.RepType.html#SlotTy"><span class="hs-identifier hs-type">SlotTy</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-141"></span><span>
</span><span id="line-142"></span><span class="hs-comment">-- | Given the arguments of a sum type constructor application,</span><span>
</span><span id="line-143"></span><span class="hs-comment">--   return the unboxed sum rep type.</span><span>
</span><span id="line-144"></span><span class="hs-comment">--</span><span>
</span><span id="line-145"></span><span class="hs-comment">-- E.g.</span><span>
</span><span id="line-146"></span><span class="hs-comment">--</span><span>
</span><span id="line-147"></span><span class="hs-comment">--   (# Int# | Maybe Int | (# Int#, Float# #) #)</span><span>
</span><span id="line-148"></span><span class="hs-comment">--</span><span>
</span><span id="line-149"></span><span class="hs-comment">-- We call `ubxSumRepType [ [IntRep], [LiftedRep], [IntRep, FloatRep] ]`,</span><span>
</span><span id="line-150"></span><span class="hs-comment">-- which returns [WordSlot, PtrSlot, WordSlot, FloatSlot]</span><span>
</span><span id="line-151"></span><span class="hs-comment">--</span><span>
</span><span id="line-152"></span><span class="hs-comment">-- INVARIANT: Result slots are sorted (via Ord SlotTy), except that at the head</span><span>
</span><span id="line-153"></span><span class="hs-comment">-- of the list we have the slot for the tag.</span><span>
</span><span id="line-154"></span><span class="annot"><a href="GHC.Types.RepType.html#ubxSumRepType"><span class="hs-identifier hs-type">ubxSumRepType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier hs-type">PrimRep</span></a></span><span class="hs-special">]</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.RepType.html#SlotTy"><span class="hs-identifier hs-type">SlotTy</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-155"></span><span id="ubxSumRepType"><span class="annot"><span class="annottext">ubxSumRepType :: [[PrimRep]] -&gt; SortedSlotTys
</span><a href="GHC.Types.RepType.html#ubxSumRepType"><span class="hs-identifier hs-var hs-var">ubxSumRepType</span></a></span></span><span> </span><span id="local-6989586621680822202"><span class="annot"><span class="annottext">[[PrimRep]]
</span><a href="#local-6989586621680822202"><span class="hs-identifier hs-var">constrs0</span></a></span></span><span>
</span><span id="line-156"></span><span>  </span><span class="hs-comment">-- These first two cases never classify an actual unboxed sum, which always</span><span>
</span><span id="line-157"></span><span>  </span><span class="hs-comment">-- has at least two disjuncts. But it could happen if a user writes, e.g.,</span><span>
</span><span id="line-158"></span><span>  </span><span class="hs-comment">-- forall (a :: TYPE (SumRep [IntRep])). ...</span><span>
</span><span id="line-159"></span><span>  </span><span class="hs-comment">-- which could never be instantiated. We still don't want to panic.</span><span>
</span><span id="line-160"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[[PrimRep]]
</span><a href="#local-6989586621680822202"><span class="hs-identifier hs-var">constrs0</span></a></span><span> </span><span class="annot"><span class="annottext">[[PrimRep]] -&gt; Int -&gt; Bool
forall a. [a] -&gt; Int -&gt; Bool
</span><a href="GHC.Utils.Misc.html#lengthLessThan"><span class="hs-operator hs-var">`lengthLessThan`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span>
</span><span id="line-161"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#WordSlot"><span class="hs-identifier hs-var">WordSlot</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-162"></span><span>
</span><span id="line-163"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-164"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span>
</span><span id="line-165"></span><span>      </span><span class="annot"><a href="#local-6989586621680822199"><span class="hs-identifier hs-type">combine_alts</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.RepType.html#SortedSlotTys"><span class="hs-identifier hs-type">SortedSlotTys</span></a></span><span class="hs-special">]</span><span>  </span><span class="hs-comment">-- slots of constructors</span><span>
</span><span id="line-166"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#SortedSlotTys"><span class="hs-identifier hs-type">SortedSlotTys</span></a></span><span>    </span><span class="hs-comment">-- final slots</span><span>
</span><span id="line-167"></span><span>      </span><span id="local-6989586621680822199"><span class="annot"><span class="annottext">combine_alts :: [SortedSlotTys] -&gt; SortedSlotTys
</span><a href="#local-6989586621680822199"><span class="hs-identifier hs-var hs-var">combine_alts</span></a></span></span><span> </span><span id="local-6989586621680822198"><span class="annot"><span class="annottext">[SortedSlotTys]
</span><a href="#local-6989586621680822198"><span class="hs-identifier hs-var">constrs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(SortedSlotTys -&gt; SortedSlotTys -&gt; SortedSlotTys)
-&gt; SortedSlotTys -&gt; [SortedSlotTys] -&gt; SortedSlotTys
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="annot"><span class="annottext">SortedSlotTys -&gt; SortedSlotTys -&gt; SortedSlotTys
</span><a href="#local-6989586621680822196"><span class="hs-identifier hs-var">merge</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[SortedSlotTys]
</span><a href="#local-6989586621680822198"><span class="hs-identifier hs-var">constrs</span></a></span><span>
</span><span id="line-168"></span><span>
</span><span id="line-169"></span><span>      </span><span class="annot"><a href="#local-6989586621680822196"><span class="hs-identifier hs-type">merge</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#SortedSlotTys"><span class="hs-identifier hs-type">SortedSlotTys</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#SortedSlotTys"><span class="hs-identifier hs-type">SortedSlotTys</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#SortedSlotTys"><span class="hs-identifier hs-type">SortedSlotTys</span></a></span><span>
</span><span id="line-170"></span><span>      </span><span id="local-6989586621680822196"><span class="annot"><span class="annottext">merge :: SortedSlotTys -&gt; SortedSlotTys -&gt; SortedSlotTys
</span><a href="#local-6989586621680822196"><span class="hs-identifier hs-var hs-var">merge</span></a></span></span><span> </span><span id="local-6989586621680822195"><span class="annot"><span class="annottext">SortedSlotTys
</span><a href="#local-6989586621680822195"><span class="hs-identifier hs-var">existing_slots</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-171"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SortedSlotTys
</span><a href="#local-6989586621680822195"><span class="hs-identifier hs-var">existing_slots</span></a></span><span>
</span><span id="line-172"></span><span>      </span><span class="annot"><a href="#local-6989586621680822196"><span class="hs-identifier hs-var">merge</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span id="local-6989586621680822194"><span class="annot"><span class="annottext">SortedSlotTys
</span><a href="#local-6989586621680822194"><span class="hs-identifier hs-var">needed_slots</span></a></span></span><span>
</span><span id="line-173"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SortedSlotTys
</span><a href="#local-6989586621680822194"><span class="hs-identifier hs-var">needed_slots</span></a></span><span>
</span><span id="line-174"></span><span>      </span><span class="annot"><a href="#local-6989586621680822196"><span class="hs-identifier hs-var">merge</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680822193"><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822193"><span class="hs-identifier hs-var">es</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680822192"><span class="annot"><span class="annottext">SortedSlotTys
</span><a href="#local-6989586621680822192"><span class="hs-identifier hs-var">ess</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680822191"><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822191"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680822190"><span class="annot"><span class="annottext">SortedSlotTys
</span><a href="#local-6989586621680822190"><span class="hs-identifier hs-var">ss</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-175"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680822189"><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822189"><span class="hs-identifier hs-var">s'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822191"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy -&gt; SlotTy -&gt; Maybe SlotTy
</span><a href="GHC.Types.RepType.html#fitsIn"><span class="hs-operator hs-var">`fitsIn`</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822193"><span class="hs-identifier hs-var">es</span></a></span><span>
</span><span id="line-176"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-comment">-- found a slot, use it</span><span>
</span><span id="line-177"></span><span>          </span><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822189"><span class="hs-identifier hs-var">s'</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy -&gt; SortedSlotTys -&gt; SortedSlotTys
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">SortedSlotTys -&gt; SortedSlotTys -&gt; SortedSlotTys
</span><a href="#local-6989586621680822196"><span class="hs-identifier hs-var">merge</span></a></span><span> </span><span class="annot"><span class="annottext">SortedSlotTys
</span><a href="#local-6989586621680822192"><span class="hs-identifier hs-var">ess</span></a></span><span> </span><span class="annot"><span class="annottext">SortedSlotTys
</span><a href="#local-6989586621680822190"><span class="hs-identifier hs-var">ss</span></a></span><span>
</span><span id="line-178"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822191"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy -&gt; SlotTy -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;</span></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822193"><span class="hs-identifier hs-var">es</span></a></span><span>
</span><span id="line-179"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-comment">-- we need a new slot and this is the right place for it</span><span>
</span><span id="line-180"></span><span>          </span><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822191"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy -&gt; SortedSlotTys -&gt; SortedSlotTys
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">SortedSlotTys -&gt; SortedSlotTys -&gt; SortedSlotTys
</span><a href="#local-6989586621680822196"><span class="hs-identifier hs-var">merge</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822193"><span class="hs-identifier hs-var">es</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy -&gt; SortedSlotTys -&gt; SortedSlotTys
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">SortedSlotTys
</span><a href="#local-6989586621680822192"><span class="hs-identifier hs-var">ess</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SortedSlotTys
</span><a href="#local-6989586621680822190"><span class="hs-identifier hs-var">ss</span></a></span><span>
</span><span id="line-181"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-182"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-comment">-- keep searching for a slot</span><span>
</span><span id="line-183"></span><span>          </span><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822193"><span class="hs-identifier hs-var">es</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy -&gt; SortedSlotTys -&gt; SortedSlotTys
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">SortedSlotTys -&gt; SortedSlotTys -&gt; SortedSlotTys
</span><a href="#local-6989586621680822196"><span class="hs-identifier hs-var">merge</span></a></span><span> </span><span class="annot"><span class="annottext">SortedSlotTys
</span><a href="#local-6989586621680822192"><span class="hs-identifier hs-var">ess</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822191"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy -&gt; SortedSlotTys -&gt; SortedSlotTys
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">SortedSlotTys
</span><a href="#local-6989586621680822190"><span class="hs-identifier hs-var">ss</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-184"></span><span>
</span><span id="line-185"></span><span>      </span><span class="hs-comment">-- Nesting unboxed tuples and sums is OK, so we need to flatten first.</span><span>
</span><span id="line-186"></span><span>      </span><span class="annot"><a href="#local-6989586621680822186"><span class="hs-identifier hs-type">rep</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier hs-type">PrimRep</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#SortedSlotTys"><span class="hs-identifier hs-type">SortedSlotTys</span></a></span><span>
</span><span id="line-187"></span><span>      </span><span id="local-6989586621680822186"><span class="annot"><span class="annottext">rep :: [PrimRep] -&gt; SortedSlotTys
</span><a href="#local-6989586621680822186"><span class="hs-identifier hs-var hs-var">rep</span></a></span></span><span> </span><span id="local-6989586621680822185"><span class="annot"><span class="annottext">[PrimRep]
</span><a href="#local-6989586621680822185"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SortedSlotTys -&gt; SortedSlotTys
forall a. Ord a =&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#sort"><span class="hs-identifier hs-var">sort</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(PrimRep -&gt; SlotTy) -&gt; [PrimRep] -&gt; SortedSlotTys
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep -&gt; SlotTy
</span><a href="GHC.Types.RepType.html#primRepSlot"><span class="hs-identifier hs-var">primRepSlot</span></a></span><span> </span><span class="annot"><span class="annottext">[PrimRep]
</span><a href="#local-6989586621680822185"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-188"></span><span>
</span><span id="line-189"></span><span>      </span><span id="local-6989586621680822184"><span class="annot"><span class="annottext">sumRep :: SortedSlotTys
</span><a href="#local-6989586621680822184"><span class="hs-identifier hs-var hs-var">sumRep</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#WordSlot"><span class="hs-identifier hs-var">WordSlot</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy -&gt; SortedSlotTys -&gt; SortedSlotTys
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[SortedSlotTys] -&gt; SortedSlotTys
</span><a href="#local-6989586621680822199"><span class="hs-identifier hs-var">combine_alts</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">([PrimRep] -&gt; SortedSlotTys) -&gt; [[PrimRep]] -&gt; [SortedSlotTys]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">[PrimRep] -&gt; SortedSlotTys
</span><a href="#local-6989586621680822186"><span class="hs-identifier hs-var">rep</span></a></span><span> </span><span class="annot"><span class="annottext">[[PrimRep]]
</span><a href="#local-6989586621680822202"><span class="hs-identifier hs-var">constrs0</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-190"></span><span>               </span><span class="hs-comment">-- WordSlot: for the tag of the sum</span><span>
</span><span id="line-191"></span><span>    </span><span class="hs-keyword">in</span><span>
</span><span id="line-192"></span><span>      </span><span class="annot"><span class="annottext">SortedSlotTys
</span><a href="#local-6989586621680822184"><span class="hs-identifier hs-var">sumRep</span></a></span><span>
</span><span id="line-193"></span><span>
</span><span id="line-194"></span><span class="annot"><a href="GHC.Types.RepType.html#layoutUbxSum"><span class="hs-identifier hs-type">layoutUbxSum</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#SortedSlotTys"><span class="hs-identifier hs-type">SortedSlotTys</span></a></span><span> </span><span class="hs-comment">-- Layout of sum. Does not include tag.</span><span>
</span><span id="line-195"></span><span>                              </span><span class="hs-comment">-- We assume that they are in increasing order</span><span>
</span><span id="line-196"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.RepType.html#SlotTy"><span class="hs-identifier hs-type">SlotTy</span></a></span><span class="hs-special">]</span><span>      </span><span class="hs-comment">-- Slot types of things we want to map to locations in the</span><span>
</span><span id="line-197"></span><span>                              </span><span class="hs-comment">-- sum layout</span><span>
</span><span id="line-198"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">]</span><span>         </span><span class="hs-comment">-- Where to map 'things' in the sum layout</span><span>
</span><span id="line-199"></span><span id="layoutUbxSum"><span class="annot"><span class="annottext">layoutUbxSum :: SortedSlotTys -&gt; SortedSlotTys -&gt; [Int]
</span><a href="GHC.Types.RepType.html#layoutUbxSum"><span class="hs-identifier hs-var hs-var">layoutUbxSum</span></a></span></span><span> </span><span id="local-6989586621680822183"><span class="annot"><span class="annottext">SortedSlotTys
</span><a href="#local-6989586621680822183"><span class="hs-identifier hs-var">sum_slots0</span></a></span></span><span> </span><span id="local-6989586621680822182"><span class="annot"><span class="annottext">SortedSlotTys
</span><a href="#local-6989586621680822182"><span class="hs-identifier hs-var">arg_slots0</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-200"></span><span>    </span><span class="annot"><span class="annottext">SortedSlotTys -&gt; IntSet -&gt; [Int]
</span><a href="#local-6989586621680822181"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">SortedSlotTys
</span><a href="#local-6989586621680822182"><span class="hs-identifier hs-var">arg_slots0</span></a></span><span> </span><span class="annot"><span class="annottext">IntSet
</span><a href="../../containers/src/Data.IntSet.Internal.html#empty"><span class="hs-identifier hs-var">IS.empty</span></a></span><span>
</span><span id="line-201"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-202"></span><span>    </span><span class="annot"><a href="#local-6989586621680822181"><span class="hs-identifier hs-type">go</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.RepType.html#SlotTy"><span class="hs-identifier hs-type">SlotTy</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../containers/src/Data.IntSet.Internal.html#IntSet"><span class="hs-identifier hs-type">IS.IntSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">]</span><span>
</span><span id="line-203"></span><span>    </span><span id="local-6989586621680822181"><span class="annot"><span class="annottext">go :: SortedSlotTys -&gt; IntSet -&gt; [Int]
</span><a href="#local-6989586621680822181"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">IntSet
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-204"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-205"></span><span>    </span><span class="annot"><a href="#local-6989586621680822181"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680822179"><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822179"><span class="hs-identifier hs-var">arg</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680822178"><span class="annot"><span class="annottext">SortedSlotTys
</span><a href="#local-6989586621680822178"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680822177"><span class="annot"><span class="annottext">IntSet
</span><a href="#local-6989586621680822177"><span class="hs-identifier hs-var">used</span></a></span></span><span>
</span><span id="line-206"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680822176"><span class="annot"><span class="annottext">slot_idx :: Int
</span><a href="#local-6989586621680822176"><span class="hs-identifier hs-var hs-var">slot_idx</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SlotTy -&gt; Int -&gt; SortedSlotTys -&gt; IntSet -&gt; Int
</span><a href="#local-6989586621680822175"><span class="hs-identifier hs-var">findSlot</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822179"><span class="hs-identifier hs-var">arg</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">SortedSlotTys
</span><a href="#local-6989586621680822183"><span class="hs-identifier hs-var">sum_slots0</span></a></span><span> </span><span class="annot"><span class="annottext">IntSet
</span><a href="#local-6989586621680822177"><span class="hs-identifier hs-var">used</span></a></span><span>
</span><span id="line-207"></span><span>         </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680822176"><span class="hs-identifier hs-var">slot_idx</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Int] -&gt; [Int]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">SortedSlotTys -&gt; IntSet -&gt; [Int]
</span><a href="#local-6989586621680822181"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">SortedSlotTys
</span><a href="#local-6989586621680822178"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; IntSet -&gt; IntSet
</span><a href="../../containers/src/Data.IntSet.Internal.html#insert"><span class="hs-identifier hs-var">IS.insert</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680822176"><span class="hs-identifier hs-var">slot_idx</span></a></span><span> </span><span class="annot"><span class="annottext">IntSet
</span><a href="#local-6989586621680822177"><span class="hs-identifier hs-var">used</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-208"></span><span>
</span><span id="line-209"></span><span>    </span><span class="annot"><a href="#local-6989586621680822175"><span class="hs-identifier hs-type">findSlot</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#SlotTy"><span class="hs-identifier hs-type">SlotTy</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#SortedSlotTys"><span class="hs-identifier hs-type">SortedSlotTys</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../containers/src/Data.IntSet.Internal.html#IntSet"><span class="hs-identifier hs-type">IS.IntSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-210"></span><span>    </span><span id="local-6989586621680822175"><span class="annot"><span class="annottext">findSlot :: SlotTy -&gt; Int -&gt; SortedSlotTys -&gt; IntSet -&gt; Int
</span><a href="#local-6989586621680822175"><span class="hs-identifier hs-var hs-var">findSlot</span></a></span></span><span> </span><span id="local-6989586621680822173"><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822173"><span class="hs-identifier hs-var">arg</span></a></span></span><span> </span><span id="local-6989586621680822172"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680822172"><span class="hs-identifier hs-var">slot_idx</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680822171"><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822171"><span class="hs-identifier hs-var">slot</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680822170"><span class="annot"><span class="annottext">SortedSlotTys
</span><a href="#local-6989586621680822170"><span class="hs-identifier hs-var">slots</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680822169"><span class="annot"><span class="annottext">IntSet
</span><a href="#local-6989586621680822169"><span class="hs-identifier hs-var">useds</span></a></span></span><span>
</span><span id="line-211"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; IntSet -&gt; Bool
</span><a href="../../containers/src/Data.IntSet.Internal.html#member"><span class="hs-identifier hs-var">IS.member</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680822172"><span class="hs-identifier hs-var">slot_idx</span></a></span><span> </span><span class="annot"><span class="annottext">IntSet
</span><a href="#local-6989586621680822169"><span class="hs-identifier hs-var">useds</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-212"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SlotTy -&gt; Maybe SlotTy
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822171"><span class="hs-identifier hs-var">slot</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe SlotTy -&gt; Maybe SlotTy -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822173"><span class="hs-identifier hs-var">arg</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy -&gt; SlotTy -&gt; Maybe SlotTy
</span><a href="GHC.Types.RepType.html#fitsIn"><span class="hs-operator hs-var">`fitsIn`</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822171"><span class="hs-identifier hs-var">slot</span></a></span><span>
</span><span id="line-213"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680822172"><span class="hs-identifier hs-var">slot_idx</span></a></span><span>
</span><span id="line-214"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-215"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SlotTy -&gt; Int -&gt; SortedSlotTys -&gt; IntSet -&gt; Int
</span><a href="#local-6989586621680822175"><span class="hs-identifier hs-var">findSlot</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822173"><span class="hs-identifier hs-var">arg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680822172"><span class="hs-identifier hs-var">slot_idx</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SortedSlotTys
</span><a href="#local-6989586621680822170"><span class="hs-identifier hs-var">slots</span></a></span><span> </span><span class="annot"><span class="annottext">IntSet
</span><a href="#local-6989586621680822169"><span class="hs-identifier hs-var">useds</span></a></span><span>
</span><span id="line-216"></span><span>    </span><span class="annot"><a href="#local-6989586621680822175"><span class="hs-identifier hs-var">findSlot</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">IntSet
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-217"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; Int
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;findSlot&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Can't find slot&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">SortedSlotTys -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">SortedSlotTys
</span><a href="#local-6989586621680822183"><span class="hs-identifier hs-var">sum_slots0</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">SortedSlotTys -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">SortedSlotTys
</span><a href="#local-6989586621680822182"><span class="hs-identifier hs-var">arg_slots0</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-218"></span><span>
</span><span id="line-219"></span><span class="hs-comment">--------------------------------------------------------------------------------</span><span>
</span><span id="line-220"></span><span>
</span><span id="line-221"></span><span class="hs-comment">-- We have 3 kinds of slots:</span><span>
</span><span id="line-222"></span><span class="hs-comment">--</span><span>
</span><span id="line-223"></span><span class="hs-comment">--   - Pointer slot: Only shared between actual pointers to Haskell heap (i.e.</span><span>
</span><span id="line-224"></span><span class="hs-comment">--     boxed objects). These come in two variants: Lifted and unlifted (see</span><span>
</span><span id="line-225"></span><span class="hs-comment">--     #19645).</span><span>
</span><span id="line-226"></span><span class="hs-comment">--</span><span>
</span><span id="line-227"></span><span class="hs-comment">--   - Word slots: Shared between IntRep, WordRep, Int64Rep, Word64Rep, AddrRep.</span><span>
</span><span id="line-228"></span><span class="hs-comment">--</span><span>
</span><span id="line-229"></span><span class="hs-comment">--   - Float slots: Shared between floating point types.</span><span>
</span><span id="line-230"></span><span class="hs-comment">--</span><span>
</span><span id="line-231"></span><span class="hs-comment">--   - Void slots: Shared between void types. Not used in sums.</span><span>
</span><span id="line-232"></span><span class="hs-comment">--</span><span>
</span><span id="line-233"></span><span class="hs-comment">-- TODO(michalt): We should probably introduce `SlotTy`s for 8-/16-/32-bit</span><span>
</span><span id="line-234"></span><span class="hs-comment">-- values, so that we can pack things more tightly.</span><span>
</span><span id="line-235"></span><span class="hs-keyword">data</span><span> </span><span id="SlotTy"><span class="annot"><a href="GHC.Types.RepType.html#SlotTy"><span class="hs-identifier hs-var">SlotTy</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="PtrLiftedSlot"><span class="annot"><a href="GHC.Types.RepType.html#PtrLiftedSlot"><span class="hs-identifier hs-var">PtrLiftedSlot</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="PtrUnliftedSlot"><span class="annot"><a href="GHC.Types.RepType.html#PtrUnliftedSlot"><span class="hs-identifier hs-var">PtrUnliftedSlot</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="WordSlot"><span class="annot"><a href="GHC.Types.RepType.html#WordSlot"><span class="hs-identifier hs-var">WordSlot</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="Word64Slot"><span class="annot"><a href="GHC.Types.RepType.html#Word64Slot"><span class="hs-identifier hs-var">Word64Slot</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="FloatSlot"><span class="annot"><a href="GHC.Types.RepType.html#FloatSlot"><span class="hs-identifier hs-var">FloatSlot</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="DoubleSlot"><span class="annot"><a href="GHC.Types.RepType.html#DoubleSlot"><span class="hs-identifier hs-var">DoubleSlot</span></a></span></span><span>
</span><span id="line-236"></span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680822156"><span id="local-6989586621680822158"><span class="annot"><span class="annottext">SlotTy -&gt; SlotTy -&gt; Bool
(SlotTy -&gt; SlotTy -&gt; Bool)
-&gt; (SlotTy -&gt; SlotTy -&gt; Bool) -&gt; Eq SlotTy
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: SlotTy -&gt; SlotTy -&gt; Bool
$c/= :: SlotTy -&gt; SlotTy -&gt; Bool
== :: SlotTy -&gt; SlotTy -&gt; Bool
$c== :: SlotTy -&gt; SlotTy -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680822136"><span id="local-6989586621680822138"><span id="local-6989586621680822141"><span id="local-6989586621680822144"><span id="local-6989586621680822147"><span id="local-6989586621680822149"><span id="local-6989586621680822151"><span class="annot"><span class="annottext">Eq SlotTy
Eq SlotTy
-&gt; (SlotTy -&gt; SlotTy -&gt; Ordering)
-&gt; (SlotTy -&gt; SlotTy -&gt; Bool)
-&gt; (SlotTy -&gt; SlotTy -&gt; Bool)
-&gt; (SlotTy -&gt; SlotTy -&gt; Bool)
-&gt; (SlotTy -&gt; SlotTy -&gt; Bool)
-&gt; (SlotTy -&gt; SlotTy -&gt; SlotTy)
-&gt; (SlotTy -&gt; SlotTy -&gt; SlotTy)
-&gt; Ord SlotTy
SlotTy -&gt; SlotTy -&gt; Bool
SlotTy -&gt; SlotTy -&gt; Ordering
SlotTy -&gt; SlotTy -&gt; SlotTy
forall a.
Eq a
-&gt; (a -&gt; a -&gt; Ordering)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; a)
-&gt; (a -&gt; a -&gt; a)
-&gt; Ord a
min :: SlotTy -&gt; SlotTy -&gt; SlotTy
$cmin :: SlotTy -&gt; SlotTy -&gt; SlotTy
max :: SlotTy -&gt; SlotTy -&gt; SlotTy
$cmax :: SlotTy -&gt; SlotTy -&gt; SlotTy
&gt;= :: SlotTy -&gt; SlotTy -&gt; Bool
$c&gt;= :: SlotTy -&gt; SlotTy -&gt; Bool
&gt; :: SlotTy -&gt; SlotTy -&gt; Bool
$c&gt; :: SlotTy -&gt; SlotTy -&gt; Bool
&lt;= :: SlotTy -&gt; SlotTy -&gt; Bool
$c&lt;= :: SlotTy -&gt; SlotTy -&gt; Bool
&lt; :: SlotTy -&gt; SlotTy -&gt; Bool
$c&lt; :: SlotTy -&gt; SlotTy -&gt; Bool
compare :: SlotTy -&gt; SlotTy -&gt; Ordering
$ccompare :: SlotTy -&gt; SlotTy -&gt; Ordering
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Ord</span></span></span></span></span></span></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-237"></span><span>    </span><span class="hs-comment">-- Constructor order is important! If slot A could fit into slot B</span><span>
</span><span id="line-238"></span><span>    </span><span class="hs-comment">-- then slot A must occur first.  E.g.  FloatSlot before DoubleSlot</span><span>
</span><span id="line-239"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-240"></span><span>    </span><span class="hs-comment">-- We are assuming that WordSlot is smaller than or equal to Word64Slot</span><span>
</span><span id="line-241"></span><span>    </span><span class="hs-comment">-- (would not be true on a 128-bit machine)</span><span>
</span><span id="line-242"></span><span>
</span><span id="line-243"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680822132"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#SlotTy"><span class="hs-identifier hs-type">SlotTy</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-244"></span><span>  </span><span id="local-6989586621680822130"><span class="annot"><span class="annottext">ppr :: SlotTy -&gt; SDoc
</span><a href="#local-6989586621680822130"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#PtrLiftedSlot"><span class="hs-identifier hs-var">PtrLiftedSlot</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;PtrLiftedSlot&quot;</span></span><span>
</span><span id="line-245"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#PtrUnliftedSlot"><span class="hs-identifier hs-var">PtrUnliftedSlot</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;PtrUnliftedSlot&quot;</span></span><span>
</span><span id="line-246"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#Word64Slot"><span class="hs-identifier hs-var">Word64Slot</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Word64Slot&quot;</span></span><span>
</span><span id="line-247"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#WordSlot"><span class="hs-identifier hs-var">WordSlot</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;WordSlot&quot;</span></span><span>
</span><span id="line-248"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#DoubleSlot"><span class="hs-identifier hs-var">DoubleSlot</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;DoubleSlot&quot;</span></span><span>
</span><span id="line-249"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#FloatSlot"><span class="hs-identifier hs-var">FloatSlot</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;FloatSlot&quot;</span></span><span>
</span><span id="line-250"></span><span>
</span><span id="line-251"></span><span class="annot"><a href="GHC.Types.RepType.html#typeSlotTy"><span class="hs-identifier hs-type">typeSlotTy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#UnaryType"><span class="hs-identifier hs-type">UnaryType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#SlotTy"><span class="hs-identifier hs-type">SlotTy</span></a></span><span>
</span><span id="line-252"></span><span id="typeSlotTy"><span class="annot"><span class="annottext">typeSlotTy :: Type -&gt; Maybe SlotTy
</span><a href="GHC.Types.RepType.html#typeSlotTy"><span class="hs-identifier hs-var hs-var">typeSlotTy</span></a></span></span><span> </span><span id="local-6989586621680822129"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822129"><span class="hs-identifier hs-var">ty</span></a></span></span><span>
</span><span id="line-253"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Bool
</span><a href="GHC.Types.RepType.html#isVoidTy"><span class="hs-identifier hs-var">isVoidTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822129"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-254"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe SlotTy
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-255"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-256"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SlotTy -&gt; Maybe SlotTy
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PrimRep -&gt; SlotTy
</span><a href="GHC.Types.RepType.html#primRepSlot"><span class="hs-identifier hs-var">primRepSlot</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; PrimRep
Type -&gt; PrimRep
</span><a href="GHC.Types.RepType.html#typePrimRep1"><span class="hs-identifier hs-var">typePrimRep1</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822129"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-257"></span><span>
</span><span id="line-258"></span><span class="annot"><a href="GHC.Types.RepType.html#primRepSlot"><span class="hs-identifier hs-type">primRepSlot</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier hs-type">PrimRep</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#SlotTy"><span class="hs-identifier hs-type">SlotTy</span></a></span><span>
</span><span id="line-259"></span><span id="primRepSlot"><span class="annot"><span class="annottext">primRepSlot :: PrimRep -&gt; SlotTy
</span><a href="GHC.Types.RepType.html#primRepSlot"><span class="hs-identifier hs-var hs-var">primRepSlot</span></a></span></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#VoidRep"><span class="hs-identifier hs-var">VoidRep</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; SlotTy
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;primRepSlot&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;No slot for VoidRep&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-260"></span><span class="annot"><a href="GHC.Types.RepType.html#primRepSlot"><span class="hs-identifier hs-var">primRepSlot</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#LiftedRep"><span class="hs-identifier hs-var">LiftedRep</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#PtrLiftedSlot"><span class="hs-identifier hs-var">PtrLiftedSlot</span></a></span><span>
</span><span id="line-261"></span><span class="annot"><a href="GHC.Types.RepType.html#primRepSlot"><span class="hs-identifier hs-var">primRepSlot</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#UnliftedRep"><span class="hs-identifier hs-var">UnliftedRep</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#PtrUnliftedSlot"><span class="hs-identifier hs-var">PtrUnliftedSlot</span></a></span><span>
</span><span id="line-262"></span><span class="annot"><a href="GHC.Types.RepType.html#primRepSlot"><span class="hs-identifier hs-var">primRepSlot</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#IntRep"><span class="hs-identifier hs-var">IntRep</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#WordSlot"><span class="hs-identifier hs-var">WordSlot</span></a></span><span>
</span><span id="line-263"></span><span class="annot"><a href="GHC.Types.RepType.html#primRepSlot"><span class="hs-identifier hs-var">primRepSlot</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#Int8Rep"><span class="hs-identifier hs-var">Int8Rep</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#WordSlot"><span class="hs-identifier hs-var">WordSlot</span></a></span><span>
</span><span id="line-264"></span><span class="annot"><a href="GHC.Types.RepType.html#primRepSlot"><span class="hs-identifier hs-var">primRepSlot</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#Int16Rep"><span class="hs-identifier hs-var">Int16Rep</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#WordSlot"><span class="hs-identifier hs-var">WordSlot</span></a></span><span>
</span><span id="line-265"></span><span class="annot"><a href="GHC.Types.RepType.html#primRepSlot"><span class="hs-identifier hs-var">primRepSlot</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#Int32Rep"><span class="hs-identifier hs-var">Int32Rep</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#WordSlot"><span class="hs-identifier hs-var">WordSlot</span></a></span><span>
</span><span id="line-266"></span><span class="annot"><a href="GHC.Types.RepType.html#primRepSlot"><span class="hs-identifier hs-var">primRepSlot</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#Int64Rep"><span class="hs-identifier hs-var">Int64Rep</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#Word64Slot"><span class="hs-identifier hs-var">Word64Slot</span></a></span><span>
</span><span id="line-267"></span><span class="annot"><a href="GHC.Types.RepType.html#primRepSlot"><span class="hs-identifier hs-var">primRepSlot</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#WordRep"><span class="hs-identifier hs-var">WordRep</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#WordSlot"><span class="hs-identifier hs-var">WordSlot</span></a></span><span>
</span><span id="line-268"></span><span class="annot"><a href="GHC.Types.RepType.html#primRepSlot"><span class="hs-identifier hs-var">primRepSlot</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#Word8Rep"><span class="hs-identifier hs-var">Word8Rep</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#WordSlot"><span class="hs-identifier hs-var">WordSlot</span></a></span><span>
</span><span id="line-269"></span><span class="annot"><a href="GHC.Types.RepType.html#primRepSlot"><span class="hs-identifier hs-var">primRepSlot</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#Word16Rep"><span class="hs-identifier hs-var">Word16Rep</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#WordSlot"><span class="hs-identifier hs-var">WordSlot</span></a></span><span>
</span><span id="line-270"></span><span class="annot"><a href="GHC.Types.RepType.html#primRepSlot"><span class="hs-identifier hs-var">primRepSlot</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#Word32Rep"><span class="hs-identifier hs-var">Word32Rep</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#WordSlot"><span class="hs-identifier hs-var">WordSlot</span></a></span><span>
</span><span id="line-271"></span><span class="annot"><a href="GHC.Types.RepType.html#primRepSlot"><span class="hs-identifier hs-var">primRepSlot</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#Word64Rep"><span class="hs-identifier hs-var">Word64Rep</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#Word64Slot"><span class="hs-identifier hs-var">Word64Slot</span></a></span><span>
</span><span id="line-272"></span><span class="annot"><a href="GHC.Types.RepType.html#primRepSlot"><span class="hs-identifier hs-var">primRepSlot</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#AddrRep"><span class="hs-identifier hs-var">AddrRep</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#WordSlot"><span class="hs-identifier hs-var">WordSlot</span></a></span><span>
</span><span id="line-273"></span><span class="annot"><a href="GHC.Types.RepType.html#primRepSlot"><span class="hs-identifier hs-var">primRepSlot</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#FloatRep"><span class="hs-identifier hs-var">FloatRep</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#FloatSlot"><span class="hs-identifier hs-var">FloatSlot</span></a></span><span>
</span><span id="line-274"></span><span class="annot"><a href="GHC.Types.RepType.html#primRepSlot"><span class="hs-identifier hs-var">primRepSlot</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#DoubleRep"><span class="hs-identifier hs-var">DoubleRep</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#DoubleSlot"><span class="hs-identifier hs-var">DoubleSlot</span></a></span><span>
</span><span id="line-275"></span><span class="annot"><a href="GHC.Types.RepType.html#primRepSlot"><span class="hs-identifier hs-var">primRepSlot</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#VecRep"><span class="hs-identifier hs-type">VecRep</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; SlotTy
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;primRepSlot&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;No slot for VecRep&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-276"></span><span>
</span><span id="line-277"></span><span class="annot"><a href="GHC.Types.RepType.html#slotPrimRep"><span class="hs-identifier hs-type">slotPrimRep</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#SlotTy"><span class="hs-identifier hs-type">SlotTy</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier hs-type">PrimRep</span></a></span><span>
</span><span id="line-278"></span><span id="slotPrimRep"><span class="annot"><span class="annottext">slotPrimRep :: SlotTy -&gt; PrimRep
</span><a href="GHC.Types.RepType.html#slotPrimRep"><span class="hs-identifier hs-var hs-var">slotPrimRep</span></a></span></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#PtrLiftedSlot"><span class="hs-identifier hs-var">PtrLiftedSlot</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#LiftedRep"><span class="hs-identifier hs-var">LiftedRep</span></a></span><span>
</span><span id="line-279"></span><span class="annot"><a href="GHC.Types.RepType.html#slotPrimRep"><span class="hs-identifier hs-var">slotPrimRep</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#PtrUnliftedSlot"><span class="hs-identifier hs-var">PtrUnliftedSlot</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#UnliftedRep"><span class="hs-identifier hs-var">UnliftedRep</span></a></span><span>
</span><span id="line-280"></span><span class="annot"><a href="GHC.Types.RepType.html#slotPrimRep"><span class="hs-identifier hs-var">slotPrimRep</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#Word64Slot"><span class="hs-identifier hs-var">Word64Slot</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#Word64Rep"><span class="hs-identifier hs-var">Word64Rep</span></a></span><span>
</span><span id="line-281"></span><span class="annot"><a href="GHC.Types.RepType.html#slotPrimRep"><span class="hs-identifier hs-var">slotPrimRep</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#WordSlot"><span class="hs-identifier hs-var">WordSlot</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#WordRep"><span class="hs-identifier hs-var">WordRep</span></a></span><span>
</span><span id="line-282"></span><span class="annot"><a href="GHC.Types.RepType.html#slotPrimRep"><span class="hs-identifier hs-var">slotPrimRep</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#DoubleSlot"><span class="hs-identifier hs-var">DoubleSlot</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#DoubleRep"><span class="hs-identifier hs-var">DoubleRep</span></a></span><span>
</span><span id="line-283"></span><span class="annot"><a href="GHC.Types.RepType.html#slotPrimRep"><span class="hs-identifier hs-var">slotPrimRep</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#FloatSlot"><span class="hs-identifier hs-var">FloatSlot</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#FloatRep"><span class="hs-identifier hs-var">FloatRep</span></a></span><span>
</span><span id="line-284"></span><span>
</span><span id="line-285"></span><span class="hs-comment">-- | Returns the bigger type if one fits into the other. (commutative)</span><span>
</span><span id="line-286"></span><span class="hs-comment">--</span><span>
</span><span id="line-287"></span><span class="hs-comment">-- Note that lifted and unlifted pointers are *not* in a fits-in relation for</span><span>
</span><span id="line-288"></span><span class="hs-comment">-- the reasons described in Note [Don't merge lifted and unlifted slots] in</span><span>
</span><span id="line-289"></span><span class="hs-comment">-- GHC.Stg.Unarise.</span><span>
</span><span id="line-290"></span><span class="annot"><a href="GHC.Types.RepType.html#fitsIn"><span class="hs-identifier hs-type">fitsIn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#SlotTy"><span class="hs-identifier hs-type">SlotTy</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#SlotTy"><span class="hs-identifier hs-type">SlotTy</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#SlotTy"><span class="hs-identifier hs-type">SlotTy</span></a></span><span>
</span><span id="line-291"></span><span id="fitsIn"><span class="annot"><span class="annottext">fitsIn :: SlotTy -&gt; SlotTy -&gt; Maybe SlotTy
</span><a href="GHC.Types.RepType.html#fitsIn"><span class="hs-identifier hs-var hs-var">fitsIn</span></a></span></span><span> </span><span id="local-6989586621680822112"><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822112"><span class="hs-identifier hs-var">ty1</span></a></span></span><span> </span><span id="local-6989586621680822111"><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822111"><span class="hs-identifier hs-var">ty2</span></a></span></span><span>
</span><span id="line-292"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822112"><span class="hs-identifier hs-var">ty1</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy -&gt; SlotTy -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822111"><span class="hs-identifier hs-var">ty2</span></a></span><span>
</span><span id="line-293"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SlotTy -&gt; Maybe SlotTy
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822112"><span class="hs-identifier hs-var">ty1</span></a></span><span>
</span><span id="line-294"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">SlotTy -&gt; Bool
</span><a href="#local-6989586621680822110"><span class="hs-identifier hs-var">isWordSlot</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822112"><span class="hs-identifier hs-var">ty1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">SlotTy -&gt; Bool
</span><a href="#local-6989586621680822110"><span class="hs-identifier hs-var">isWordSlot</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822111"><span class="hs-identifier hs-var">ty2</span></a></span><span>
</span><span id="line-295"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SlotTy -&gt; Maybe SlotTy
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SlotTy -&gt; SlotTy -&gt; SlotTy
forall a. Ord a =&gt; a -&gt; a -&gt; a
</span><span class="hs-identifier hs-var">max</span></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822112"><span class="hs-identifier hs-var">ty1</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822111"><span class="hs-identifier hs-var">ty2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-296"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">SlotTy -&gt; Bool
</span><a href="#local-6989586621680822107"><span class="hs-identifier hs-var">isFloatSlot</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822112"><span class="hs-identifier hs-var">ty1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">SlotTy -&gt; Bool
</span><a href="#local-6989586621680822107"><span class="hs-identifier hs-var">isFloatSlot</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822111"><span class="hs-identifier hs-var">ty2</span></a></span><span>
</span><span id="line-297"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SlotTy -&gt; Maybe SlotTy
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SlotTy -&gt; SlotTy -&gt; SlotTy
forall a. Ord a =&gt; a -&gt; a -&gt; a
</span><span class="hs-identifier hs-var">max</span></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822112"><span class="hs-identifier hs-var">ty1</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680822111"><span class="hs-identifier hs-var">ty2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-298"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-299"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe SlotTy
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-300"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-301"></span><span>    </span><span id="local-6989586621680822110"><span class="annot"><span class="annottext">isWordSlot :: SlotTy -&gt; Bool
</span><a href="#local-6989586621680822110"><span class="hs-identifier hs-var hs-var">isWordSlot</span></a></span></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#Word64Slot"><span class="hs-identifier hs-var">Word64Slot</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-302"></span><span>    </span><span class="annot"><a href="#local-6989586621680822110"><span class="hs-identifier hs-var">isWordSlot</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#WordSlot"><span class="hs-identifier hs-var">WordSlot</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-303"></span><span>    </span><span class="annot"><a href="#local-6989586621680822110"><span class="hs-identifier hs-var">isWordSlot</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><span class="hs-identifier">_</span></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-304"></span><span>
</span><span id="line-305"></span><span>    </span><span id="local-6989586621680822107"><span class="annot"><span class="annottext">isFloatSlot :: SlotTy -&gt; Bool
</span><a href="#local-6989586621680822107"><span class="hs-identifier hs-var hs-var">isFloatSlot</span></a></span></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#DoubleSlot"><span class="hs-identifier hs-var">DoubleSlot</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-306"></span><span>    </span><span class="annot"><a href="#local-6989586621680822107"><span class="hs-identifier hs-var">isFloatSlot</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#FloatSlot"><span class="hs-identifier hs-var">FloatSlot</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-307"></span><span>    </span><span class="annot"><a href="#local-6989586621680822107"><span class="hs-identifier hs-var">isFloatSlot</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><span class="hs-identifier">_</span></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-308"></span><span>
</span><span id="line-309"></span><span>
</span><span id="line-310"></span><span class="hs-comment">{- **********************************************************************
*                                                                       *
                   PrimRep
*                                                                       *
*************************************************************************

Note [RuntimeRep and PrimRep]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This Note describes the relationship between GHC.Types.RuntimeRep
(of levity-polymorphism fame) and GHC.Core.TyCon.PrimRep, as these types
are closely related.

A &quot;primitive entity&quot; is one that can be
 * stored in one register
 * manipulated with one machine instruction


Examples include:
 * a 32-bit integer
 * a 32-bit float
 * a 64-bit float
 * a machine address (heap pointer), etc.
 * a quad-float (on a machine with SIMD register and instructions)
 * ...etc...

The &quot;representation or a primitive entity&quot; specifies what kind of register is
needed and how many bits are required. The data type GHC.Core.TyCon.PrimRep
enumerates all the possibilities.

data PrimRep
  = VoidRep
  | LiftedRep     -- ^ Lifted pointer
  | UnliftedRep   -- ^ Unlifted pointer
  | Int8Rep       -- ^ Signed, 8-bit value
  | Int16Rep      -- ^ Signed, 16-bit value
  ...etc...
  | VecRep Int PrimElemRep  -- ^ SIMD fixed-width vector

The Haskell source language is a bit more flexible: a single value may need multiple PrimReps.
For example

  utup :: (# Int, Int #) -&gt; Bool
  utup x = ...

Here x :: (# Int, Int #), and that takes two registers, and two instructions to move around.
Unboxed sums are similar.

Every Haskell expression e has a type ty, whose kind is of form TYPE rep
   e :: ty :: TYPE rep
where rep :: RuntimeRep. Here rep describes the runtime representation for e's value,
but RuntimeRep has some extra cases:

data RuntimeRep = VecRep VecCount VecElem   -- ^ a SIMD vector type
                | TupleRep [RuntimeRep]     -- ^ An unboxed tuple of the given reps
                | SumRep [RuntimeRep]       -- ^ An unboxed sum of the given reps
                | LiftedRep       -- ^ lifted; represented by a pointer
                | UnliftedRep     -- ^ unlifted; represented by a pointer
                | IntRep          -- ^ signed, word-sized value
                ...etc...

It's all in 1-1 correspondence with PrimRep except for TupleRep and SumRep,
which describe unboxed products and sums respectively. RuntimeRep is defined
in the library ghc-prim:GHC.Types. It is also &quot;wired-in&quot; to GHC: see
GHC.Builtin.Types.runtimeRepTyCon. The unarisation pass, in GHC.Stg.Unarise, transforms the
program, so that every variable has a type that has a PrimRep. For
example, unarisation transforms our utup function above, to take two Int
arguments instead of one (# Int, Int #) argument.

See also Note [Getting from RuntimeRep to PrimRep] and Note [VoidRep].

Note [VoidRep]
~~~~~~~~~~~~~~
PrimRep contains a constructor VoidRep, while RuntimeRep does
not. Yet representations are often characterised by a list of PrimReps,
where a void would be denoted as []. (See also Note [RuntimeRep and PrimRep].)

However, after the unariser, all identifiers have exactly one PrimRep, but
void arguments still exist. Thus, PrimRep includes VoidRep to describe these
binders. Perhaps post-unariser representations (which need VoidRep) should be
a different type than pre-unariser representations (which use a list and do
not need VoidRep), but we have what we have.

RuntimeRep instead uses TupleRep '[] to denote a void argument. When
converting a TupleRep '[] into a list of PrimReps, we get an empty list.

Note [Getting from RuntimeRep to PrimRep]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
General info on RuntimeRep and PrimRep is in Note [RuntimeRep and PrimRep].

How do we get from an Id to the list or PrimReps used to store it? We get
the Id's type ty (using idType), then ty's kind ki (using typeKind), then
pattern-match on ki to extract rep (in kindPrimRep), then extract the PrimRep
from the RuntimeRep (in runtimeRepPrimRep).

We now must convert the RuntimeRep to a list of PrimReps. Let's look at two
examples:

  1. x :: Int#
  2. y :: (# Int, Word# #)

With these types, we can extract these kinds:

  1. Int# :: TYPE IntRep
  2. (# Int, Word# #) :: TYPE (TupleRep [LiftedRep, WordRep])

In the end, we will get these PrimReps:

  1. [IntRep]
  2. [LiftedRep, WordRep]

It would thus seem that we should have a function somewhere of
type `RuntimeRep -&gt; [PrimRep]`. This doesn't work though: when we
look at the argument of TYPE, we get something of type Type (of course).
RuntimeRep exists in the user's program, but not in GHC as such.
Instead, we must decompose the Type of kind RuntimeRep into tycons and
extract the PrimReps from the TyCons. This is what runtimeRepPrimRep does:
it takes a Type and returns a [PrimRep]

runtimeRepPrimRep works by using tyConRuntimeRepInfo. That function
should be passed the TyCon produced by promoting one of the constructors
of RuntimeRep into type-level data. The RuntimeRep promoted datacons are
associated with a RuntimeRepInfo (stored directly in the PromotedDataCon
constructor of TyCon). This pairing happens in GHC.Builtin.Types. A RuntimeRepInfo
usually(*) contains a function from [Type] to [PrimRep]: the [Type] are
the arguments to the promoted datacon. These arguments are necessary
for the TupleRep and SumRep constructors, so that this process can recur,
producing a flattened list of PrimReps. Calling this extracted function
happens in runtimeRepPrimRep; the functions themselves are defined in
tupleRepDataCon and sumRepDataCon, both in GHC.Builtin.Types.

The (*) above is to support vector representations. RuntimeRep refers
to VecCount and VecElem, whose promoted datacons have nuggets of information
related to vectors; these form the other alternatives for RuntimeRepInfo.

Returning to our examples, the Types we get (after stripping off TYPE) are

  1. TyConApp (PromotedDataCon &quot;IntRep&quot;) []
  2. TyConApp (PromotedDataCon &quot;TupleRep&quot;)
              [TyConApp (PromotedDataCon &quot;:&quot;)
                        [ TyConApp (AlgTyCon &quot;RuntimeRep&quot;) []
                        , TyConApp (PromotedDataCon &quot;LiftedRep&quot;) []
                        , TyConApp (PromotedDataCon &quot;:&quot;)
                                   [ TyConApp (AlgTyCon &quot;RuntimeRep&quot;) []
                                   , TyConApp (PromotedDataCon &quot;WordRep&quot;) []
                                   , TyConApp (PromotedDataCon &quot;'[]&quot;)
                                              [TyConApp (AlgTyCon &quot;RuntimeRep&quot;) []]]]]

runtimeRepPrimRep calls tyConRuntimeRepInfo on (PromotedDataCon &quot;IntRep&quot;), resp.
(PromotedDataCon &quot;TupleRep&quot;), extracting a function that will produce the PrimReps.
In example 1, this function is passed an empty list (the empty list of args to IntRep)
and returns the PrimRep IntRep. (See the definition of runtimeRepSimpleDataCons in
GHC.Builtin.Types and its helper function mk_runtime_rep_dc.) Example 2 passes the promoted
list as the one argument to the extracted function. The extracted function is defined
as prim_rep_fun within tupleRepDataCon in GHC.Builtin.Types. It takes one argument, decomposes
the promoted list (with extractPromotedList), and then recurs back to runtimeRepPrimRep
to process the LiftedRep and WordRep, concatentating the results.

-}</span><span>
</span><span id="line-468"></span><span>
</span><span id="line-469"></span><span class="hs-comment">-- | Discovers the primitive representation of a 'Type'. Returns</span><span>
</span><span id="line-470"></span><span class="hs-comment">-- a list of 'PrimRep': it's a list because of the possibility of</span><span>
</span><span id="line-471"></span><span class="hs-comment">-- no runtime representation (void) or multiple (unboxed tuple/sum)</span><span>
</span><span id="line-472"></span><span class="hs-comment">-- See also Note [Getting from RuntimeRep to PrimRep]</span><span>
</span><span id="line-473"></span><span class="annot"><a href="GHC.Types.RepType.html#typePrimRep"><span class="hs-identifier hs-type">typePrimRep</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html#HasDebugCallStack"><span class="hs-identifier hs-type">HasDebugCallStack</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier hs-type">PrimRep</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-474"></span><span id="typePrimRep"><span class="annot"><span class="annottext">typePrimRep :: HasDebugCallStack =&gt; Type -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#typePrimRep"><span class="hs-identifier hs-var hs-var">typePrimRep</span></a></span></span><span> </span><span id="local-6989586621680822100"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822100"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; SDoc -&gt; Type -&gt; [PrimRep]
SDoc -&gt; Type -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#kindPrimRep"><span class="hs-identifier hs-var">kindPrimRep</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;typePrimRep&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-475"></span><span>                              </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822100"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#dcolon"><span class="hs-identifier hs-var">dcolon</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; Type
Type -&gt; Type
</span><a href="GHC.Core.Type.html#typeKind"><span class="hs-identifier hs-var">typeKind</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822100"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-476"></span><span>                             </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; Type
Type -&gt; Type
</span><a href="GHC.Core.Type.html#typeKind"><span class="hs-identifier hs-var">typeKind</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822100"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-477"></span><span>
</span><span id="line-478"></span><span class="hs-comment">-- | Like 'typePrimRep', but assumes that there is precisely one 'PrimRep' output;</span><span>
</span><span id="line-479"></span><span class="hs-comment">-- an empty list of PrimReps becomes a VoidRep.</span><span>
</span><span id="line-480"></span><span class="hs-comment">-- This assumption holds after unarise, see Note [Post-unarisation invariants].</span><span>
</span><span id="line-481"></span><span class="hs-comment">-- Before unarise it may or may not hold.</span><span>
</span><span id="line-482"></span><span class="hs-comment">-- See also Note [RuntimeRep and PrimRep] and Note [VoidRep]</span><span>
</span><span id="line-483"></span><span class="annot"><a href="GHC.Types.RepType.html#typePrimRep1"><span class="hs-identifier hs-type">typePrimRep1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html#HasDebugCallStack"><span class="hs-identifier hs-type">HasDebugCallStack</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#UnaryType"><span class="hs-identifier hs-type">UnaryType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier hs-type">PrimRep</span></a></span><span>
</span><span id="line-484"></span><span id="typePrimRep1"><span class="annot"><span class="annottext">typePrimRep1 :: HasDebugCallStack =&gt; Type -&gt; PrimRep
</span><a href="GHC.Types.RepType.html#typePrimRep1"><span class="hs-identifier hs-var hs-var">typePrimRep1</span></a></span></span><span> </span><span id="local-6989586621680822087"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822087"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; [PrimRep]
Type -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#typePrimRep"><span class="hs-identifier hs-var">typePrimRep</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822087"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-485"></span><span>  </span><span class="hs-special">[</span><span class="hs-special">]</span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#VoidRep"><span class="hs-identifier hs-var">VoidRep</span></a></span><span>
</span><span id="line-486"></span><span>  </span><span class="hs-special">[</span><span id="local-6989586621680822086"><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621680822086"><span class="hs-identifier hs-var">rep</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621680822086"><span class="hs-identifier hs-var">rep</span></a></span><span>
</span><span id="line-487"></span><span>  </span><span class="annot"><span class="annottext">[PrimRep]
</span><span class="hs-identifier">_</span></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; PrimRep
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;typePrimRep1&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822087"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">[PrimRep] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; [PrimRep]
Type -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#typePrimRep"><span class="hs-identifier hs-var">typePrimRep</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822087"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-488"></span><span>
</span><span id="line-489"></span><span class="hs-comment">-- | Find the runtime representation of a 'TyCon'. Defined here to</span><span>
</span><span id="line-490"></span><span class="hs-comment">-- avoid module loops. Returns a list of the register shapes necessary.</span><span>
</span><span id="line-491"></span><span class="hs-comment">-- See also Note [Getting from RuntimeRep to PrimRep]</span><span>
</span><span id="line-492"></span><span class="annot"><a href="GHC.Types.RepType.html#tyConPrimRep"><span class="hs-identifier hs-type">tyConPrimRep</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html#HasDebugCallStack"><span class="hs-identifier hs-type">HasDebugCallStack</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier hs-type">PrimRep</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-493"></span><span id="tyConPrimRep"><span class="annot"><span class="annottext">tyConPrimRep :: HasDebugCallStack =&gt; TyCon -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#tyConPrimRep"><span class="hs-identifier hs-var hs-var">tyConPrimRep</span></a></span></span><span> </span><span id="local-6989586621680822080"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680822080"><span class="hs-identifier hs-var">tc</span></a></span></span><span>
</span><span id="line-494"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; SDoc -&gt; Type -&gt; [PrimRep]
SDoc -&gt; Type -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#kindPrimRep"><span class="hs-identifier hs-var">kindPrimRep</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;kindRep tc&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680822080"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822079"><span class="hs-identifier hs-var">res_kind</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-495"></span><span>                </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822079"><span class="hs-identifier hs-var">res_kind</span></a></span><span>
</span><span id="line-496"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-497"></span><span>    </span><span id="local-6989586621680822079"><span class="annot"><span class="annottext">res_kind :: Type
</span><a href="#local-6989586621680822079"><span class="hs-identifier hs-var hs-var">res_kind</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Type
</span><a href="GHC.Core.TyCon.html#tyConResKind"><span class="hs-identifier hs-var hs-var">tyConResKind</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680822080"><span class="hs-identifier hs-var">tc</span></a></span><span>
</span><span id="line-498"></span><span>
</span><span id="line-499"></span><span class="hs-comment">-- | Like 'tyConPrimRep', but assumed that there is precisely zero or</span><span>
</span><span id="line-500"></span><span class="hs-comment">-- one 'PrimRep' output</span><span>
</span><span id="line-501"></span><span class="hs-comment">-- See also Note [Getting from RuntimeRep to PrimRep] and Note [VoidRep]</span><span>
</span><span id="line-502"></span><span class="annot"><a href="GHC.Types.RepType.html#tyConPrimRep1"><span class="hs-identifier hs-type">tyConPrimRep1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html#HasDebugCallStack"><span class="hs-identifier hs-type">HasDebugCallStack</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier hs-type">PrimRep</span></a></span><span>
</span><span id="line-503"></span><span id="tyConPrimRep1"><span class="annot"><span class="annottext">tyConPrimRep1 :: HasDebugCallStack =&gt; TyCon -&gt; PrimRep
</span><a href="GHC.Types.RepType.html#tyConPrimRep1"><span class="hs-identifier hs-var hs-var">tyConPrimRep1</span></a></span></span><span> </span><span id="local-6989586621680822070"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680822070"><span class="hs-identifier hs-var">tc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; TyCon -&gt; [PrimRep]
TyCon -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#tyConPrimRep"><span class="hs-identifier hs-var">tyConPrimRep</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680822070"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-504"></span><span>  </span><span class="hs-special">[</span><span class="hs-special">]</span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#VoidRep"><span class="hs-identifier hs-var">VoidRep</span></a></span><span>
</span><span id="line-505"></span><span>  </span><span class="hs-special">[</span><span id="local-6989586621680822069"><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621680822069"><span class="hs-identifier hs-var">rep</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621680822069"><span class="hs-identifier hs-var">rep</span></a></span><span>
</span><span id="line-506"></span><span>  </span><span class="annot"><span class="annottext">[PrimRep]
</span><span class="hs-identifier">_</span></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; PrimRep
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tyConPrimRep1&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680822070"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">[PrimRep] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; TyCon -&gt; [PrimRep]
TyCon -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#tyConPrimRep"><span class="hs-identifier hs-var">tyConPrimRep</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680822070"><span class="hs-identifier hs-var">tc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-507"></span><span>
</span><span id="line-508"></span><span class="hs-comment">-- | Take a kind (of shape @TYPE rr@) and produce the 'PrimRep's</span><span>
</span><span id="line-509"></span><span class="hs-comment">-- of values of types of this kind.</span><span>
</span><span id="line-510"></span><span class="hs-comment">-- See also Note [Getting from RuntimeRep to PrimRep]</span><span>
</span><span id="line-511"></span><span class="annot"><a href="GHC.Types.RepType.html#kindPrimRep"><span class="hs-identifier hs-type">kindPrimRep</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html#HasDebugCallStack"><span class="hs-identifier hs-type">HasDebugCallStack</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier hs-type">PrimRep</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-512"></span><span id="kindPrimRep"><span class="annot"><span class="annottext">kindPrimRep :: HasDebugCallStack =&gt; SDoc -&gt; Type -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#kindPrimRep"><span class="hs-identifier hs-var hs-var">kindPrimRep</span></a></span></span><span> </span><span id="local-6989586621680822059"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621680822059"><span class="hs-identifier hs-var">doc</span></a></span></span><span> </span><span id="local-6989586621680822058"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822058"><span class="hs-identifier hs-var">ki</span></a></span></span><span>
</span><span id="line-513"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680822057"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822057"><span class="hs-identifier hs-var">ki'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Maybe Type
</span><a href="GHC.Core.Type.html#coreView"><span class="hs-identifier hs-var">coreView</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822058"><span class="hs-identifier hs-var">ki</span></a></span><span>
</span><span id="line-514"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; SDoc -&gt; Type -&gt; [PrimRep]
SDoc -&gt; Type -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#kindPrimRep"><span class="hs-identifier hs-var">kindPrimRep</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621680822059"><span class="hs-identifier hs-var">doc</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822057"><span class="hs-identifier hs-var">ki'</span></a></span><span>
</span><span id="line-515"></span><span class="annot"><a href="GHC.Types.RepType.html#kindPrimRep"><span class="hs-identifier hs-var">kindPrimRep</span></a></span><span> </span><span id="local-6989586621680822056"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621680822056"><span class="hs-identifier hs-var">doc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyConApp"><span class="hs-identifier hs-type">TyConApp</span></a></span><span> </span><span id="local-6989586621680822054"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680822054"><span class="hs-identifier hs-var">typ</span></a></span></span><span> </span><span class="hs-special">[</span><span id="local-6989586621680822053"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822053"><span class="hs-identifier hs-var">runtime_rep</span></a></span></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-516"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">typ</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">hasKey</span><span class="hs-special">`</span><span> </span><span class="hs-identifier">tYPETyConKey</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-517"></span><span>    </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; SDoc -&gt; Type -&gt; [PrimRep]
SDoc -&gt; Type -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#runtimeRepPrimRep"><span class="hs-identifier hs-var">runtimeRepPrimRep</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621680822056"><span class="hs-identifier hs-var">doc</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822053"><span class="hs-identifier hs-var">runtime_rep</span></a></span><span>
</span><span id="line-518"></span><span class="annot"><a href="GHC.Types.RepType.html#kindPrimRep"><span class="hs-identifier hs-var">kindPrimRep</span></a></span><span> </span><span id="local-6989586621680822048"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621680822048"><span class="hs-identifier hs-var">doc</span></a></span></span><span> </span><span id="local-6989586621680822047"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822047"><span class="hs-identifier hs-var">ki</span></a></span></span><span>
</span><span id="line-519"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; [PrimRep]
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;kindPrimRep&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822047"><span class="hs-identifier hs-var">ki</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621680822048"><span class="hs-identifier hs-var">doc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-520"></span><span>
</span><span id="line-521"></span><span class="hs-comment">-- | Take a type of kind RuntimeRep and extract the list of 'PrimRep' that</span><span>
</span><span id="line-522"></span><span class="hs-comment">-- it encodes. See also Note [Getting from RuntimeRep to PrimRep]</span><span>
</span><span id="line-523"></span><span class="annot"><a href="GHC.Types.RepType.html#runtimeRepPrimRep"><span class="hs-identifier hs-type">runtimeRepPrimRep</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html#HasDebugCallStack"><span class="hs-identifier hs-type">HasDebugCallStack</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier hs-type">PrimRep</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-524"></span><span id="runtimeRepPrimRep"><span class="annot"><span class="annottext">runtimeRepPrimRep :: HasDebugCallStack =&gt; SDoc -&gt; Type -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#runtimeRepPrimRep"><span class="hs-identifier hs-var hs-var">runtimeRepPrimRep</span></a></span></span><span> </span><span id="local-6989586621680822041"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621680822041"><span class="hs-identifier hs-var">doc</span></a></span></span><span> </span><span id="local-6989586621680822040"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822040"><span class="hs-identifier hs-var">rr_ty</span></a></span></span><span>
</span><span id="line-525"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680822039"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822039"><span class="hs-identifier hs-var">rr_ty'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Maybe Type
</span><a href="GHC.Core.Type.html#coreView"><span class="hs-identifier hs-var">coreView</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822040"><span class="hs-identifier hs-var">rr_ty</span></a></span><span>
</span><span id="line-526"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; SDoc -&gt; Type -&gt; [PrimRep]
SDoc -&gt; Type -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#runtimeRepPrimRep"><span class="hs-identifier hs-var">runtimeRepPrimRep</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621680822041"><span class="hs-identifier hs-var">doc</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822039"><span class="hs-identifier hs-var">rr_ty'</span></a></span><span>
</span><span id="line-527"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyConApp"><span class="hs-identifier hs-type">TyConApp</span></a></span><span> </span><span id="local-6989586621680822038"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680822038"><span class="hs-identifier hs-var">rr_dc</span></a></span></span><span> </span><span id="local-6989586621680822037"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680822037"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822040"><span class="hs-identifier hs-var">rr_ty</span></a></span><span>
</span><span id="line-528"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#RuntimeRep"><span class="hs-identifier hs-type">RuntimeRep</span></a></span><span> </span><span id="local-6989586621680822035"><span class="annot"><span class="annottext">[Type] -&gt; [PrimRep]
</span><a href="#local-6989586621680822035"><span class="hs-identifier hs-var">fun</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; RuntimeRepInfo
</span><a href="GHC.Core.TyCon.html#tyConRuntimeRepInfo"><span class="hs-identifier hs-var">tyConRuntimeRepInfo</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680822038"><span class="hs-identifier hs-var">rr_dc</span></a></span><span>
</span><span id="line-529"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; [PrimRep]
</span><a href="#local-6989586621680822035"><span class="hs-identifier hs-var">fun</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680822037"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-530"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-531"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; [PrimRep]
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;runtimeRepPrimRep&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621680822041"><span class="hs-identifier hs-var">doc</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680822040"><span class="hs-identifier hs-var">rr_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-532"></span><span>
</span><span id="line-533"></span><span class="hs-comment">-- | Convert a PrimRep back to a Type. Used only in the unariser to give types</span><span>
</span><span id="line-534"></span><span class="hs-comment">-- to fresh Ids. Really, only the type's representation matters.</span><span>
</span><span id="line-535"></span><span class="hs-comment">-- See also Note [RuntimeRep and PrimRep]</span><span>
</span><span id="line-536"></span><span class="annot"><a href="GHC.Types.RepType.html#primRepToType"><span class="hs-identifier hs-type">primRepToType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier hs-type">PrimRep</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-537"></span><span id="primRepToType"><span class="annot"><span class="annottext">primRepToType :: PrimRep -&gt; Type
</span><a href="GHC.Types.RepType.html#primRepToType"><span class="hs-identifier hs-var hs-var">primRepToType</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type
</span><a href="GHC.Builtin.Types.html#anyTypeOfKind"><span class="hs-identifier hs-var">anyTypeOfKind</span></a></span><span> </span><span class="annot"><span class="annottext">(Type -&gt; Type) -&gt; (PrimRep -&gt; Type) -&gt; PrimRep -&gt; Type
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type
</span><a href="GHC.Builtin.Types.Prim.html#tYPE"><span class="hs-identifier hs-var">tYPE</span></a></span><span> </span><span class="annot"><span class="annottext">(Type -&gt; Type) -&gt; (PrimRep -&gt; Type) -&gt; PrimRep -&gt; Type
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep -&gt; Type
</span><a href="GHC.Builtin.Types.Prim.html#primRepToRuntimeRep"><span class="hs-identifier hs-var">primRepToRuntimeRep</span></a></span><span>
</span><span id="line-538"></span></pre></body></html>